import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

/**
 * Created by Zemus on 8/21/2014.
 */
public class Project {


    public static void main(String[] args) {
        BufferedReader br = null;
        //String inputFile = JOptionPane.showInputDialog(null, "Enter the input file name");
        //String outputFile = JOptionPane.showInputDialog(null, "Enter the output file name");
        ArrayList<Projects> projects = new ArrayList();
        int i = 0;

        try {


            String sCurrentLine;

            br = new BufferedReader(new FileReader("src/KnapSackData1.txt"));
            sCurrentLine = br.readLine();
           while(sCurrentLine != null) {
               String array[] = sCurrentLine.split(" ");// reads current line and
               sCurrentLine = br.readLine();
               Projects p1 = new Projects(array[0], Integer.parseInt(array[1]), Integer.parseInt(array[2]));
               projects.add(p1);

               System.out.println(projects.get(i).getMoney());
               i++;
           }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (br != null)
                    br.close();
            } catch (IOException ex) {
                ex.printStackTrace();

            }
        }

        }
    }


